package com.example.demo;

import java.io.IOException;
import java.util.Properties;

public class Main {
    public Properties properties;

    public String loadProperties(String key) throws IOException {
        if (properties == null) {
            properties = new Properties();
            properties.load(this.getClass().getClassLoader().getResourceAsStream("application.properties"));
        }
        return properties.getProperty(key);
    }

    public static void main(String[] args)throws IOException{
        Main main = new Main();
        System.out.println(main.loadProperties("hello"));
    }
}
